package com.zb.system.controller;


import com.zb.result.PageUtil;
import com.zb.result.Result;
import com.zb.service.ZjCustomerAuthorService;
import com.zb.utils.TokenUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 * 商家权限菜单表 前端控制器
 * </p>
 *
 * @author WEN
 * @since 2024-02-20
 */
@Api(tags = "系统权限菜单")
@RestController
@RequestMapping("/system/customer/author")
public class ZjCustomerAuthorController {
    @Resource
    private ZjCustomerAuthorService customerAuthorService;

    @ApiOperation("获取所有菜单权限")
    @GetMapping("/getAllAuthor")
    public Result getAllAuthor(HttpServletRequest request) {
        Long custAccId = TokenUtil.getcustAccIdByToken(request);
        return Result.success("获取所有菜单权限成功").data(PageUtil.rows(customerAuthorService.getAllAuthor(custAccId)));
    }

}
